 package org.edu.modules.pub.controller;

 import com.github.xiaoymin.knife4j.annotations.ApiSort;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.edu.common.api.vo.Result;
 import org.edu.common.aspect.annotation.AutoLog;
 import org.edu.common.system.base.controller.BaseController;
 import org.edu.modules.pub.entity.VeFileImage;
 import org.edu.modules.pub.service.IVeFileImageService;
 import org.edu.modules.pub.vo.VeFileImageVO;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
























 @Api(tags = {"文件服务"})
 @RestController
 @RequestMapping({"/pub/veFileImage"})
 @ApiSort(0)
 public class VeFileImageController
   extends BaseController<VeFileImage, IVeFileImageService>
 {
/* 52 */   private static final Logger log = LoggerFactory.getLogger(org.edu.modules.pub.controller.VeFileImageController.class);



   @Autowired
   private IVeFileImageService veFileImageService;


   @Value("${edu.path.urlPre}")
   private String fileUrlPre;



   @AutoLog("文件服务-查询图片")
   @ApiOperation(value = "查询image表", notes = "图片表-查询图片")
   @PostMapping({"/queryById"})
   public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
     VeFileImage veFileImage = (VeFileImage)this.veFileImageService.getById(id);
/* 70 */     if (veFileImage == null) {
/* 71 */       return Result.error("未找到对应数据");
     }
     VeFileImageVO veFileImageVO = new VeFileImageVO();
/* 74 */     BeanUtils.copyProperties(veFileImage, veFileImageVO);
/* 75 */     veFileImageVO.setSourcefile(this.fileUrlPre + veFileImage.getSourcefile());
/* 76 */     veFileImageVO.setDownloadurl(this.fileUrlPre + "pub/file/download/" + veFileImage.getSourcefile());
     return Result.OK(veFileImageVO);
   }
 }



